Calendar Component Events
Description
Information about client-side and server-side events for the Calendar Component.
Discussion
When the Calendar component is run initially, server and client-side events fire in the following order: onComponentInitialize -> onComponentExecute -> onInitialRender
When an Ajax callback is made, events fire in the following order: canAjaxCallback -> onComponentExecute -> afterAjaxCallbackComplete
Server-side Events
All server-side events have access to the following properties, available via the e object, which is passed to both events.
- e.tmpl
An object containing the Calendar component's definition (i.e. properties.) You can modify the definition to change the Calendar component's behavior.
- e.rtc
An object for storing runtime calculations. Placing data in e.rtc makes it available to Xbasic in other server-side events.
- e.arguments
SQL::Arguments object that contains the values assigned to arguments defined in the Calendar component. Arguments can be read using the find() method. For example: e.arguments.find("argumentName").data
Server-side events can also access Server objects to create or read session, request, and response variables. See the Context Object to learn more about methods available for these objects.
- Request
The Request object. See Request Object for methods available for the Request object on the Classic Application Server. IMPORTANT If you are running the Application Server for IIS, you must use Context.Request, not Request to access the request variable information. See Context.Request object for more information.
- Session
The Session object. Can be used to create server-side session variables to store state information that can be accessed throughout a web application.
onComponentInitialize Event
Fires the first time a component is run. The onComponentInitialize does not fire more than once.
onComponentExecute Event
Fires every time the component is run, including on Ajax callbacks.
Client-side Events
canAjaxCallback Event
Fires before an Ajax callback. If the function returns false, the callback will be aborted.
Parameters
JavaScript in the canAjaxCallback event can reference the following parameters:
- e.xbasicFunctionName
The name of the Xbasic function that will be called.
- e.ajaxEvent
The Xbasic event that will be called.
afterAjaxCallbackComplete Event
Fire after an Ajax callback has completed.
Parameters
JavaScript in the afterAjaxCallbackComplete event can reference the following parameters:
- e.xbasicFunctionName
The name of the Xbasic function that was executed in the callback.
- e.ajaxEvent
The Xbasic event that was executed in the callback.
onInitializeComplete Event
Fires after the Calendar component is completely initialized and all HTML has been rendered. It fires once when the Calendar component is first rendered. onInitializeComplete not fire on subsequent Ajax callbacks.
onInitializeComplete does not have any parameters.
onEventsLoad Event
Fires when events are loaded.
onEventsLoad does not have any parameters.
onRenderComplete Event
The last event to fire when the Calendar component is rendered.
onRenderComplete does not have any parameters.